class IssuesComments
  attr_accessor :github

  def initialize(github)
    @github = github
  end

  def listIssueComments(repo, id, user=nil)
    url = 'repos/%s/%s/issues/%s/comments' % [user, repo, id]
    @github.get(url)
  end

  def getIssueComment(repo, id, user=nil)
    url = 'repos/%s/%s/issues/comments/%s' % [user, repo, id]
    @github.get(url)
  end

  def listIssues(repo, id, body, user=nil)
    params = {
        :body => body
    }
    data = params.to_json
    url = 'repos/%s/%s/issues/%s/comments' % [user, repo, id]
    @github.post(url, data)
  end

  def editComment(repo, id, body, user=nil)
    params = {
        :body => body
    }
    data = params.to_json
    url = 'repos/%s/%s/issues/comments/%s' % [user, repo, id]
    @github.patch(url, data)
  end

  def deleteComment(repo, id, user=nil)
    url = 'repos/%s/%s/issues/comments/%s' % [user, repo, id]
    @github.delete(url)
  end
end